home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
223_01
/
read.c
< prev
next >
Wrap
Text File
|
1980-01-01
|
640b
|
29 lines
/*
** read.c by F. A. Scacchitti 3/22/86
*/
#include <stdio.h>
extern int zzbuf;
static int i, n;
static char *tbuff, flag;
read(fd,buffer,cnt) int fd, cnt; char *buffer; {
tbuff = &zzbuf;
n=0;
while(cnt >0){
if((flag = bdos(20,fd)) != NULL) {
*(fd + 40) = flag;
return(n);
}else
i = 0;
while(i <= 127 && cnt > 0){ buffer[n] = tbuff[i];
i++; cnt--; n++; }
}
return(n);
}